package com.huluobo.a2302mdmdemo.demo

import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 *  Created by LC on 2025/7/17.
 */

@Composable
fun MyText() {
    Column(
        Modifier.fillMaxSize(),
        //纵向的间隔
        verticalArrangement = Arrangement.spacedBy(20.dp),
        //横向的位置
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        Text(text = "LC")
        Text(text = "LC")
        Spacer(modifier = Modifier.height(20.dp))
        Text(text = "LC")
        Text(text = "LC")
        Text(text = "LC")
        Text(text = "LC")
        Row(
            Modifier.fillMaxWidth(),
            horizontalArrangement = Arrangement.SpaceBetween,
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(text = "LC")
            Text(text = "LC")
            Spacer(modifier = Modifier.width(20.dp))
            Text(text = "LC")
            Text(text = "LC")
            Text(text = "LC")
            Text(text = "LC")
        }
    }


//    Text(
//        text = "LC12312736812376198273891729381923890128390123", modifier = Modifier
//            .clickable {
//                Log.e("TagA", "点击了文本")
//            }
//            .fillMaxWidth()
//            .height(100.dp),
//        //文本位置
//        textAlign = TextAlign.Center,
//        //文本颜色,2种形式,第一种可以直接设置颜色
////        color = Color.Red,
//        //第二种可以读取colors.xml中的颜色
//        color = colorResource(id = R.color.purple_200),
//        //字体大小,在compose中,所有的尺寸比如dp sp 都需要加点才能使用
//        fontSize = 22.sp,
//        //字体权重
//        fontWeight = FontWeight.Bold,
//        //最大行数
//        maxLines = 1,
//        //超出范围后
//        overflow = TextOverflow.Ellipsis,
//        //字符间距
//        letterSpacing = 10.sp
//    )
}